package com.hu.common.pojo.dto;

import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

@ApiOperation(value = "表格分页数据对象")
@Data
public class TableDataInfo<T> implements Serializable {
    private static final long serialVersionUID = 1L;

    @JsonPropertyOrder("1")
    @ApiModelProperty(value = "消息状态码")
    private int code;

    @JsonPropertyOrder("2")
    @ApiModelProperty(value = "消息内容")
    private String msg;

    @JsonPropertyOrder("3")
    @ApiModelProperty(value = "总记录数")
    private long total;

    @JsonPropertyOrder("4")
    @ApiModelProperty(value = "当前页码")
    private int current;


    @JsonPropertyOrder("5")
    @ApiModelProperty(value = "列表数据")
    private List<T> data;


    public TableDataInfo() {
    }

    /**
     * 分页
     *
     * @param list  列表数据
     * @param total 总记录数
     */
    public TableDataInfo(List<T> list, int total) {
        this.data = list;
        this.total = total;
    }
}



